Disk array unit and its method for writing data

ABSTRACT

Writing in each sector of a series of sectors of a recording medium in which data is to be written caused by a single data write request location information which is information indicating a location of the sector in the series of sectors and common information which varies every time data writing to the series of sectors occurs and is information set relating to the series of sectors.

CROSS-REFERENCE TO RELATED APPLICATION

[0001] The base patent application of this application JP-A-2003-111406filed on Apr. 16, 2003 in Japan is incorporated herein by reference.

BACKGROUND OF THE INVENTION

[0002] The present invention relates to a method for writing data, amethod for data validation, a method for computer control, a computer, adisk array unit, and a disk drive.

[0003] It is conventionally known as a method for detecting error ofdata stored in a recording medium such as CD-ROM, DVD-ROM, and the like,to use EDC (Error Detection Code). Also, it is known to detect error bycomparing a expected value address computed from address information ofa sector and a sector number read out from the sector.

[0004] However, these conventional error detection methods were notsufficient as a mechanism for detecting data write omission in sectorunit, for example, when data writing to a recording medium has not beenperformed normally due to a head voltage shortage at writing or dust onthe recording medium.

SUMMARY OF THE INVENTION

[0005] The present invention has been made in consideration of thissituation and the object of the present invention is to provide a methodfor writing data, a method for data validation, a method for computercontrol, a computer, a disk array unit, and a disk drive which candetect the data write omission in sector unit with more certainty.

[0006] The primary invention of the present invention to achieve thisobject is the method for writing data, and it comprises writing in eachsector of a series of sectors of a recording medium in which data is tobe written caused by a single data write request location informationwhich is information indicating a location of the sector in the seriesof sectors and common information which varies every time data writingto the series of sectors occurs and is information set relating to theseries of sectors.

[0007] Here, the location information is, for example, location datawhich will be described later. Also, the common information is, forexample, common data which will be described later. When data is writtenin a recording medium by this data writing method, by detecting databased on the location information and the common information which areread out, the data write omission in sector unit which occurs when datawriting to the recording medium has not been performed normally due to ahead voltage shortage at writing or dust on the recording medium can bedetected with more certainty. Here, the detection is performed, forexample, by deciding whether the common data of a given sector is thedata relating to (for example the same as) the common data of a sectorimmediately before the sector or not when the location information ofthe sector is information indicating that the sector is neither a headsector nor a tail sector of the series of sectors.

[0008] Moreover, the subject and its solution which the presentinvention discloses will become apparent from the following detaileddescription of the preferred embodiments and the accompanying drawings,and so on.

[0009] According to the present invention there can be provided a methodfor writing data, a method for data validation, a method for computercontrol, a computer, a disk array unit, and a disk drive which candetect the data write omission in sector unit with more certainty.

[0010] Other objects, features and advantages of the invention willbecome apparent from the following description of the embodiments of theinvention taken in conjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Preferred embodiments of the present invention will now bedescribed in conjunction with the accompanying drawings, in which:

[0012]FIG. 1 shows the structure of a disk drive according to anembodiment of the present invention.

[0013]FIG. 2 shows the composition of data of a check code according toan embodiment of the present invention.

[0014]FIG. 3 illustrates a mechanism in which data write omission insector unit is detected using the check code according to an embodimentof the present invention.

[0015]FIG. 4 illustrate a mechanism in which data write omission insector unit is detected using the check code according to an embodimentof the present invention.

[0016]FIG. 5 is a block diagram of a computer described as a firstexample of application according to an embodiment of the presentinvention.

[0017]FIG. 6 is a block diagram of a storage system described as asecond example of application according to an embodiment of the presentinvention.

[0018]FIG. 7 is a flow chart describing a process performed in a diskarray unit when it receives a data write request from a informationprocessing unit according to an embodiment of the present invention.

[0019]FIG. 8 is a flow chart describing a process performed in a diskarray unit when it receives a data read request from a informationprocessing unit according to an embodiment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

[0020] The mechanism of data validation according to the presentinvention will be described below, taking as an example a case where arecording medium is a magnetic disk incorporated in a disk drive. FIG. 1shows the structure of a disk drive 100 which will be described as anembodiment of the invention. Disk drive 100 is constructed comprising inits enclosure 105, a magnetic disk 110, an actuator 111, a spindle motor112, a head 113, a structure control circuit 114 which controls thestructure parts such as the head 113 and the like, a signal processingcircuit 115 which controls read/write signal of data to the magneticdisk 110, a communication interface circuit 116, a interface connector116 to which a plurality of kinds of commands and data are input andoutput, a power connector 117, and so on. Further, as a communicationinterface circuit 116, for example, a circuit which corresponds to SCSI1(Small Computer System Interface 1), SCSI2, SCSI3, FC-AL (Fibre ChannelArbitrated Loop), ATA (AT Attachment), etc., is adopted.

[0021] In this disk drive 100, the memory area of the magnetic disk 110is managed being divided into cylinder, track and sector. Among these acylinder is an area partitioned in a cylindrical form in a plurality ofmagnetic disks 110 stacked on the same axis. Also, a track is a ringarea partitioned in concentric circles on each magnetic disk 110. Totrack, for example, track number is assigned in order from the mostexternal circumferential track. A sector is an area partitioned bydividing a track in a circumferential direction. To each sector in atrack, for example, a sector number is assigned in order having a givensector as a starting position. Further, for the magnetic disk 110described in this embodiment, it is assumed that 512 byte data can bestored in one sector.

[0022] In each sector of the magnetic disk 110, 1 byte check code whichis a code to validate the data is stored. FIG. 2 shows the compositionof data of the check code. The check code 200 is composed comprising alocation data area 210 which is a 2-bit area in which locationinformation is stored, the location information is informationindicating a location of the sector in the series of sectors in whichdata is to be written caused by a single data write request issued byCPU and the like, and, a common data area 211 which is a 6-bit area inwhich common data is stored, the common data is information which variesevery time a data write request is issued by CPU and the like and is setrelating to the series of sectors.

[0023] In the location data area 210 one of the following values is setas a location data: “10” which is data indicating that the sector is ahead sector of the series of sectors, “01” which is data indicating thatthe sector is a tail sector of the series of sectors, “11” which is dataindicating that the sector is a head sector and also a tail sector ofthe series of sectors (i.e., when the series of sectors consists of onesector), “00” which is data indicating that the sector is neither a headnor a tail sector of the series of sectors. Also, in this embodiment,the common data is assumed to be set to the same value for all thesectors in the series of sectors, and an alphabet is set in rotation inthe common data area 211 as common data every time a data write requestfrom CPU and the like occurs. Namely, with whether the common data isthe same value or not, it can be decided whether the sector is a sectorrelating to the series of sectors or not. Further, other than settingthe same value, for example, using data with order such as integer orderor alphabetical order as common data, it can be decided whether it is aseries of sectors that were written caused by a single data writerequest or not.

[0024] The magnetic disk 110 of this embodiment can detect the datawrite omission in sector unit caused by a head voltage shortage or duston the recording medium, with such check code being given.

[0025] Next, the mechanism of detecting the data write omission insector unit using the check code will be described with reference toFIG. 3 and FIG. 4. Here, in FIG. 3 and FIG. 4, for example, when it isindicated “10-A”, the section before “-” (in this case “10”) indicatesthe location data, and the section after “-” (in this case “A”)indicates the common data.

[0026] First, an example shown in FIG. 3 will be described. FIG. 3(a)shows the contents of the check codes stored in each sector from sector(N) to sector (N+4) on the magnetic disk 110 before data writing isperformed. In this figure, in the location data of the sector (N), “10”is set, which indicates that the sector is a head sector of the seriesof sectors written corresponding to a write request. Alternatively, inthe location data of the sector (N+4), “01” is set, which indicates thatthe sector is a tail sector of the series of sectors. Further, insectors from sector (N+1) to sector (N+3), “00” is set, which indicatesthat each sector is neither a head sector nor a tail sector of theseries of sectors. Moreover, in the common data of each sector fromsector (N) to sector (N+4) “A” is commonly set in all of them.

[0027] In this condition, assume that a new data write request occurredand a write operation has been performed for the sectors from sector(N+2) to sector (N+5) of the magnetic disk as shown in FIG. 3(b). Here,if the write operation has been performed normally, the contents of eachsector from (N) to (N+5) should be the contents shown in FIG. 3(c), but,here, assume that a data write omission has occurred by some cause orother, thereby the contents of the sector (N+3) has not been rewrittenand remains as shown in FIG. 3(d)

[0028] In this case, it is possible to detect that the data of thesector (N+3) is abnormal by reading out the common data and the locationdata written in each of the continuous sectors and validating the databased on the relation of the common data written in each of thecontinuous sectors to the relation of the location data written in eachsector. For example, in FIG. 3 (d), when reading out sequentially thedata stored in the sectors from sector (N+2) to sector (N+5), as thelocation data of the sector (N+2) is set to “10”, the data is identifiedas a head sector of the series of sectors written by a single writeprocess. Therefore, the location data of the following sector (N+3)should be “00” or “01”. And, as the common data of the sector (N+2) is“B” and the location data is “10”, the common data of the followingsector (N+3) should be “B”. Then, reading out the contents of the sector(N+3), its location data is “00” but its common data is “A” where itshould be “B”, therefore it is detected that the data stored in thesector (N+3) is abnormal.

[0029] Next, the mechanism of detection will be described with referenceto an example shown in FIG. 4. FIG. 4(a) shows the contents of the checkcodes stored in each sector from sector (N+2) to sector (N+5) on themagnetic disk before data writing is performed. In this figure, in thelocation data of the sector (N+2) “10” is set indicating that the sectoris a head sector of the series of sectors in which the sector exists,and which is written corresponding to a write request. Alternatively, inthe location data of the sector (N+5), “01” is set, which indicates thatthe sector is a tail sector of the series of sectors. Further, insectors (N+3) and (N+4) “00” is set indicating that each sector isneither a head sector nor a tail sector of the series of sectors. And,in the common data of each sector from (N+2) to (N+5) “A” is set in allof them.

[0030] In this condition, assume that a new data write request occurredand a write operation has been performed for the sectors from (N) to(N+3) of the magnetic disk as shown in FIG. 4(b). Here, if the writeoperation has been performed normally, the contents of each sector from(N) to (N+5) should be the contents as shown in FIG. 4(c), but assumethat a data write omission has occurred by some cause or other, therebythe contents of the sector (N+3) has not been rewritten and remains asshown in FIG. 4(d).

[0031] In this case, it is possible to detect that the data of thesector (n+3) is abnormal by reading out the common data and the locationdata written in each of the continuous sectors and validating the databased on the relation of the common data written in each sector of thecontinuous sectors to the relation of the location data written in eachsector. For example, in FIG. 4(d), when reading out sequentially thedata stored in sectors from sector (N) to sector (N+5), as the locationdata of the sector (N) is set to “10”, it is identified as a head sectorof the series of sectors written by a single write process. Therefore,the location data of the sector (N+1) following the sector (N) has to be“00”, and the location data of each following sector has to be “00”until a sector with “01” stored as location data appears. And, as thecommon data of the sector (N) is “B” and its location data is “10”, thecommon data of each following sector has to be “B” until a sector with“01” stored as location data appears. However, as at the sector (N+3)the common data is “A” though a sector with location data “01” has notappeared yet, it is detected that the data stored in the sector (N+3) isabnormal.

[0032] Additionally, above description is in the case where the datasize of the check code is 1 byte, but the check code is not limited tothis data size. Particularly, regarding to the common data, by settingthe data size bigger and spreading the variable area, it becomes lessfrequently that the common codes has the same value for different writerequest, for example, it is less likely that the same common code is setto the continuous sectors in which data is written by different writerequests, and it is possible to detect the abnormality of data with morecertainty.

FIRST EXAMPLE OF APPLICATION

[0033] Next, an example of application of the above described datavalidation mechanism will be described. FIG. 5 is a block structure of acomputer 500 which will be described as a first example of application.The computer 500 is, for example, a personal computer, a workstation ora main frame computer, and the like. The computer 500 is constructedcomprising a CPU 510, a memory 511 such as RAM, ROM, a input device 512such as keyboard or mouse, a input device control unit 513 whichcontrols the input device 512, a display device 514 such as display, adisplay device control unit 515 which controls the display device 514, arecording medium read device 516 such as flexible disk read device,CD-ROM device, DVD-ROM device, a disk controller 517, more than one diskdrive 518, and so on. The disk controller 517 performs write and readoperation to and from the disk drive 518. Also, the disk controller 517is provided with a function to control the disk drive 518 with themechanism of RAID (e.g., 0, 1, 5).

[0034] In this computer 500, the above described mechanism of giving andvalidating the above described check code can be implemented, forexample, by a program executed by the CPU 510. Also, it can beconstructed to give and validate the check code at the disk controller517. By having the structure to give and validate the check code on theside of the disk controller 517, the load on the side of the CPU 510 canbe reduced.

[0035] Also, in case where the disk controller 517 controls the diskdrive 518 by the RAID5 method, when an abnormality is detected in dataof disk drive 518, data corresponding to the sector in which the datawas written can be generated by other disk drive 518. Thereby, theavailability, reliability, and the like, of the computer 500 can beimproved.

[0036] Further, in case where the disk drive 518 is controlled by theRAID5 method, data is to be divided into data of given size and eachdivided data is to be written in a distributed manner in a plurality ofdisk drives 518, in this case, by a method other than the method to givecheck code on the side of the disk drive, a series of data written by asingle write request which is given the same common data is to bewritten in a distributed manner in a plurality of disk drives 518. Thiscould occur more notably particularly when the data size of the divideddata is closer to the data size of the data written in sector unit.However, even in such case, when new data is to be written in a sectorcontinuous to the sector in which writing was performed immediatelybefore, it is possible to detect a data write omission using the checkcode.

[0037] Additionally, the mechanism of giving and validating the checkcode can be implemented, for example, on the side of the disk drive 518.In this case, for example, a circuit which executes software to give andvalidate the check code is implemented on the side of the disk drive518. Also, for example, a circuit to give and validate the check codecan be implemented on the side of the disk drive 518. When the mechanismof giving and validating the check code is implemented on the side ofthe disk drive 518, the processing load of the CPU 510 or the diskcontroller 517 is reduced. Also, in this case, when an abnormality isdetected by the validation of the check code, a signal can be outputfrom the disk drive 518 to the CPU 510 indicating that an abnormalityhas been detected.

SECOND EXAMPLE OF APPLICATION

[0038]FIG. 6 is a block diagram of a storage system constructedcomprising a disk array unit 600, which will be described as a secondexample of application. To the disk array unit 600, a informationprocessing unit 650 accesses via a channel 640. Here, the informationprocessing unit 650 is a computer provided with CPU (Central ProcessingUnit) and memory, such as a personal computer, a workstation, and a mainframe computer. For the communication of the channel 640 a communicationprotocol such as TCP/IP protocol, Fibre Channel Protocol, FICON (FibreConnection) (trademark), and ESCON (Enterprise SystemConnection)(trademark) is adopted.

[0039] The disk array unit 600 is constructed comprising a channelcontrol unit (communication control unit) 610, a disk control unit (I/Ocontrol unit) 620, a cash memory 630, a shared memory 631, a switch 632connecting these units, a disk drive 633, and so on. Among these units,the channel control unit 610 is provided with a communication interface611 which provides a function relating to the communication with theinformation processing unit 650, a memory 612, a microprocessor 613which implements a plurality of kinds of functions of the channelcontrol unit 610 by executing programs stored in the memory 612, an I/Oprocessor 614 which realizes high speed data transfer between thechannel control unit 610 and the cash memory 630, and so on. As an I/Oprocessor 614, for example, a DMA (Direct Memory Access) processor isused. As a switch 632, for example, a high speed cross bus switch isused.

[0040] The disk control unit 620 is provided with a memory 621, amicroprocessor 622 which implements a plurality of kinds of functions ofthe disk control unit 620 by executing programs stored in the memory621, a disk controller 623 which writes and reads data to and from thedisk drive 633, an I/O processor 624 which realizes high speed datatransfer between the cash memory 630 and the channel control unit 610,and so on. As an I/O processor 624, for example, a DMA (Direct MemoryAccess) processor is used. The disk controller 623 also provides afunction to control the disk drive 633 by the RAID method (e.g., RAID0,1, 5).

[0041] The shared memory 631 and the cash memory 630 are used, forexample, to store control information, commands, and the like. The cashmemory 630 is used, for example, to store data which is to be written inthe disk drive 633 or data which has been read out from the disk drive633.

[0042] Next, a basic operation of the disk array unit 600 when itreceives a data input/output request such as a data write request or adata read request sent from the information processing unit 650 will bedescribed. First, it will be described the case where a data writerequest is sent from the information processing unit 650 to the diskarray unit 600. On receiving a data write request sent from theinformation processing unit 650, the disk array unit 600 writes a datawrite command to the shared memory 631 and also writes write datareceived from the information processing unit 650 to the cash memory630. The disk array unit 600, when it completed writing to the cashmemory 630, sends a write completion report to the informationprocessing unit 650. Namely, the completion report to the informationprocessing unit 650 is done asynchronously to the actual write operationof the data to the disk drive 633. The disk control unit 620 monitorsthe contents of the shared memory 631 in real time (e.g., at regulartime intervals). When the disk control unit 620 detects by this monitorthat a data write command has been written in the shared memory 631, itreads out data which is the object of the write operation (hereafter itis called write data) from the cash memory 630 and write this write datawhich it has read out to the disk drive 633. In this manner, writing ofthe data to the disk drive 633 corresponding to the data write requestis performed.

[0043] Next, the basic operation of the disk array unit 600 when a dataread request is sent from the information processing unit 650 to thedisk array unit 600 will be described. On receiving a data read requestsent from the information processing unit 650, the disk array unit 600sends out a data read command corresponding to this request to the diskcontrol unit 620. Also, the transmission of the data read command fromthe channel control unit 610 to the disk control unit 620 may be donevia the shared memory 631.

[0044] On receiving the data read command from the channel control unit610, the disk control unit 620 reads out the read object data designatedby the command from the disk drive 633, and writes this read out data tothe cash memory 630. When the data transfer to the cash memory 630 iscompleted the disk control unit 620 gives notice to that effect to thechannel control unit 610. And on receiving this notice the channelcontrol unit 610 transfers the read object data stored in the cashmemory 630 to the information processing unit 650.

[0045] Here, in the disk array unit 600 consisting of the abovestructure, the above described mechanism of data validation can beimplemented, for example, by implementing the function for this purposein the channel control unit 610 and the disk control unit 620. Below, anembodiment will be described which is constructed to give and validatethe check code in the channel control unit 610.

[0046]FIG. 7 is a flowchart which describes the process performed at thedisk array unit 600 when it receives a data write request from theinformation processing unit 650. On receiving a data write request fromthe information processing unit 650 (S710), the microprocessor 613 ofthe channel control unit 610 stores the data which is the object ofwriting (hereafter it is called write data) and is sent with the datawrite request in the memory 612 (S711). Next, the microprocessor 613initializes a block counter which is a variable to be stored in aregister of the I/O processor 614 or in the memory 612 (S712) and alsosends out to the I/O processor 614 a transfer directive to the cashmemory 630 relating to the write data (S713). Here, assume that “n” isset as a block number to the block counter by above initialization.Also, the microprocessor 613 computes a block number corresponding tothe write data by dividing the write data by block size and sets thiscomputed block number to a maximum block counter which is a variable tobe stored in the memory 612 (S714).

[0047] The I/O processor 614, on receiving the transfer directive, readsout data of the given data size (e.g., 512 bytes) of the write datastored in the memory 612 (S715). Also, the I/O processor 614 generates acheck code with location data set to “10” and common data set to “A”respectively (S716), generates data for 1 sector by adding the generatedcheck code to the data of block size which was read out, and stores thisdata in the cash memory 630 (S717). Further, data indicating by whichwrite command the data is written is to be added to the data for 1sector which is to be written in the cash memory 630.

[0048] Next, the I/O processor 614 counts up (increments) the blockcounter to “n+1” (S718), compares the value of block counter after beingcounted up with the value of maximum block counter to check whether thevalue of block counter is greater that the value of maximum blockcounter (S719). Here, if it is greater (S719:YES), the microprocessor613 judges that it has written all the write data corresponding to thedata write request to the cash memory 630, and sends a write completionnotice for the data write request to the information processing unit 650via the channel 640 (S720). Also, at this point, the microprocessor 613writes a data write command to the shared memory 631. Here, to the datawrite command to be written in the shared memory 631, information toidentify each data write command existing in the shared memory 631,information to specify the location of the write data corresponding tothe write command on the cash memory (e.g., an address to manage memoryarea of the cash memory 630), etc., are added. Also, the microprocessor613 counts up the value of common data preparing for when it receives adata write request next time (S721). On the other hand, at (S719), ifthe value of block counter is not greater that the value of maximumblock counter (S719:NO) the process from (S715) is executed repeatedly.

[0049] The microprocessor 622 of the disk control unit 620 monitors thecontents of the shared memory 631 in real time. This monitor isperformed, for example, at regular time intervals (e.g., every some μS).The disk control unit 620, on detecting that a data write request hasbeen written newly in the shared memory 631 by this monitoring,initiates a write process to the disk drive 633 relating to the writedata stored in the cash memory 630.

[0050] The disk control unit 620 specifies the location of the writedata corresponding to the write command on the cash memory 630 from theinformation added to the write command in the shared memory 631,initiates a write process of the write data stored in the specifiedaddress to the disk drive 633. Further, here, if the disk drive 633which is the destination of the write operation is controlled, forexample, by the RAID5, the write data is to be divided into a pluralityof data, and each of the divided data is to be written in a distributedmanner in a plurality of disk drives 633. Also, on writing, thecomputation of parity is performed at the disk controller 623 and thecomputed parity is stored in a disk drive 633 which is designated as aparity storage (hereinafter it is called a parity drive). On computingparity, the disk controller 623 reads out a group of data (hereinafterit is called stripe data) which is stored in respective write locationof the disk drive 633 which is a write destination, and stores the readout stripe data in the memory 621. Next, the disk controller 623reflects the write process by this time write data to the stripe data,and also, performs again the parity computation for the stripe dataafter the write process is reflected. And, the disk controller 623stores the computed parity in the parity drive and also stores thestripe data after the write process reflection in original location ofrespective corresponding disk drive. Further, the series of processes ofreading out the stripe data from the disk drive 633 and reflecting thewrite process, computing again parity for the stripe data after thewrite process reflection, storing again the computed parity and thestripe data after the write process reflection in the disk drive 633 isalso called Read Modify Write process.

[0051] Other than the RAID5, if the write destination disk drive 633 iscontrolled by, for example, the RAID1 method, the disk controller 623,on writing the data, writes the data to the disk drive 633 which is setto be origin of duplication and also writes the data to the disk drivewhich is set to be destination of duplication.

[0052] In this manner, when the disk array unit receives a data writerequest from the information processing unit, by performing the abovedescribed process at the disk array unit, in the series of sectors ofthe disk drive 633 in which data is written caused by a single datawrite request being sent from the information processing unit 650, acheck code is to be written, in which location information which isinformation indicating the location of each sector in the series ofsectors and common data which varies every time writing to the series ofsectors occurs and is information set relating to the series of sectorsare set.

[0053] <Process on Receiving a Data Read Request>

[0054] Next, it will be described about the mechanism of data validationperformed when the disk array unit 600 receives a data read request fromthe information processing unit 650, with reference to a flow chartshown in FIG. 8.

[0055] The channel control unit 610, on receiving a data read request(S811), sends a data read command to the disk control unit 620 (S812).The disk control unit 620, on receiving the read command, sends a dataread directive to the disk drive 633 (S813). When the disk control unit620 detects that the preparation for the data transfer is completed onthe side of the disk drive 633, it gives notice to that effect to thechannel control unit 610, and the transfer of the read object data fromthe disk drive 633 to the channel control unit 610 is initiated (S814).At this data transfer, first, “OFF” is set to a check flag which is avariable to be stored in the memory 621 of the channel control unit 610.Also, “0” is set to a block counter which is a counter used to specifythe sector in which the read object data is stored. Also, the number ofblocks to be read out by the data read request which is obtained bydividing the data which is read out by the data read request by blocksize is set to a maximum block counter (S815). Next, the value of theblock counter is counted up (added 1) (S816). Then, the I/O processor624 checks whether the location data of the data stored in the sectordesignated by the block counter (hereafter it is called a sector in theprocess) within the data read out from the disk drive 633 is “01” or not(S817). Here, if the location data is “01” (S817:01), the process checksif the check flag is “ON” or not (S818), and if the check flag resultsto be “ON” (S818:YES), the common data of the sector in the process iscompared with the common data of the sector immediately before thesector in the process (S819), if both are not the same (S819:NO), it isjudged that there is an abnormality in the data stored in the sector inthe process and a process corresponding to the error is performed(S820). Here, at this error corresponding process, for example, the I/Oprocessor 614 of the channel control unit 610 gives notice to the I/Oprocessor 624 of the disk control unit 620 that a error has occurred,and the I/O processor 624 of the disk control unit 620 regenerates thedata of the sector in the process, for example, according to the RAID5method, and transfers this data to the information processing unit 650.Further, in this case, the regenerated data may be written in the sectorin the process of the disk drive 633 to repair the data of the sector inthe process of the disk drive 633.

[0056] At (S819), if the common data are the same (S819:YES), theprocess sets the check flag to “OFF” (S821) and proceeds to the nextprocess (S838). Also, at (S818), if the check flag is “OFF”, the processproceeds accordingly to the process of (S838).

[0057] At the process of (S817), if the location data is other than “01”(S817:other than 01), the process proceeds to the process of (S830). Atthe process of (S830), if the location data is “10” (S830:10), the I/Oprocessor 614 sets the check flag to “ON” (S831), and stores the valueof the common data of the sector in the process in the memory 612(S832).

[0058] At the process of (S830), if the location data is “00”, theprocess proceeds next to the process of (S835) (S830:00). At the processof (S835), the I/O processor 614 checks whether the check flag is “ON”or not (S835). Here if the check flag is not “ON” (S835:NO), the processproceeds to the process of (S831). Alternatively, if the check flag is“ON” (S835:YES), the process compares the common data stored at (S832)with the common data of the sector in the process and if both are notthe same (S836:NO), it judges that there is an abnormality in the datastored in the sector in the process and performs the same error processas described above (S837). Alternatively, if the common data are thesame (S836:YES), the process proceeds to the process of (S838) and thedata stored in the sector in the process is transferred to the cashmemory 630 by the I/O processor 624 of the disk control unit 620 (S838).

[0059] At the following process of (S840), the I/O processor 614 of thechannel control unit 610 checks whether the block counter is the same asthe maximum block counter or not (S840), and if they are not the same(S840:NO) the process proceeds next to the process of (S816) andinitiates the process relating to the following sector.

[0060] On the other hand, if the block counter is the same as themaximum block counter (S840:YES), it is noticed from the disk controlunit 620 to the channel control unit 610 that the data transfer to thecash memory 630 is completed (S841), and when the channel control unit610 receives the notice, the data stored in the cash memory 630 istransferred to the information processing unit 650 by the I/O processor614 of the channel control unit 610 (S842). Additionally, in the aboveprocess if the location data is “11” it is judged to be “01” (S817), butit may be judged to be “10” and be so processed, and in the process ofFIG. 8 the branch at (S817) and the branch at (S830) may be reversed intheir context.

[0061] Here, in above described embodiments, check code giving andvalidation is arranged to be performed at the channel control unit 610,but it may be arranged to be performed at the disk control unit 620.Also, check code giving may be performed at the channel control unit 610and validation may be performed at the disk control unit 620. Further,it may be constructed to perform check code giving at the disk controlunit 620 and to perform validation at the channel control unit 610.

[0062] Additionally, in above described embodiments the validation ofthe check code is performed on reading out the data, but in case wherethe check code is given at the channel control unit 610 corresponding tothe data write request from the information processing unit 650, thecheck code may be validated at the disk control unit 620 at the datawriting. By having such structure, for example, an abnormality such aslack of data which occurred in the write data after the check code wasgiven at the channel control unit 610 can be detected on the side of thedisk control unit 620.

[0063] Also, as it was described with the first example of application,in case where the data writing to the disk drive 633 is performed by theRAID5 method, it may be constructed to give or validate the check codeon performing the above described read modify write.

[0064] Also, as it was described with the first example of application,the mechanism of giving and validating the check code may beimplemented, for example, on the side of the disk drive 633. In thiscase, for example, a circuit to execute software to give and validatethe check code is implemented in the disk drive 633. Or, for example, acircuit to give and validate the check code is implemented in the diskdrive 633. By performing the check code giving and validation on theside of the disk drive 633 like this, the processing load of the diskcontrol unit 620 or the channel control unit 610 can be reduced.Further, when an abnormality is detected by validating the check code,it may be arranged to output a signal indicating that an abnormality hasbeen detected from the disk drive 633 to the disk control unit 620 orthe channel control unit 610.

[0065] In above described embodiments, it has been explained the casewhere the recording medium is the magnetic disk of the disk drive, butthe recording medium may be, for example, CD-ROM, DVD-ROM, CD-R, CD-RW,DVD-R, DVD-RW, DVD-RAM, and the like. Also, the mechanism of datavalidation according to the embodiments can be applied to the datacommunication.

[0066] Additionally, the form of the above described embodiments is tomake it easy to understand the present invention, and does not limit thescope of the present invention. The present invention can be changed andmodified without departing from the spirit and scope of the invention,and, needless to say, the equivalents are included in the invention.

What is claimed is:
 1. A method for writing data to a recording medium,said method comprising: writing in each sector of a series of sectors ofthe recording medium in which data is to be written caused by a singledata write request location information which is information indicatinga location of the sector in the series of sectors and common informationwhich varies every time data writing to the series of sectors occurs andis information set relating to the series of sectors.
 2. A method forwriting data according to claim 1, wherein at least one of the followinginformation is set in the location information: information indicatingthat the sector is a head sector of the series of sectors; informationindicating that the sector is a tail sector of the series of sectors;information indicating that the sector is neither a head sector nor atail sector of the series of sectors.
 3. A method for writing data to arecording medium according to claim 1, wherein the recording medium is amagnetic disk.
 4. A method for validating data comprising the steps of:writing in each sector of a series of sectors of a recording medium inwhich data is to be written caused by a single data write requestlocation information which is information indicating a location of thesector in the series of sectors and common information which variesevery time data writing to the series of sectors occurs and isinformation set relating to the series of sectors; reading out thelocation information and the common information which are written ineach sector of the continuous sectors of the recording medium;validating data based on the read out location information and commoninformation.
 5. A method for validating data according to claim 4,wherein the step of validating data is the step of: validating datastored in a sector by deciding whether the common data of the sector isthe same as the common data of a sector immediately before the sectorwhen the location information of the sector is information indicatingthat the sector is neither a head sector nor a tail sector of the seriesof sectors.
 6. A method for controlling a computer constructedcomprising a communication control unit which provides a function tocommunicate with an external device; an I/O control unit which writesand reads data to and from a recording medium; a cash memory which thecommunication control unit and the I/O control unit can access; saidmethod comprising the steps of: the communication control unit receivesa data write request from the external device; the communication controlunit writes in data to be written in each sector of a series of sectorsof the recording medium in which data is to be written caused by thedata write request location information which is information indicatinga location of the sector in the series of sectors and common informationwhich varies every time data writing to the series of sectors occurs andis information set relating to the series of sectors.
 7. A method forcontrolling a computer constructed comprising a communication controlunit which provides a function to communicate with an external device;an I/O control unit which writes and reads data to and from a recordingmedium; a cash memory which the communication control unit and the I/Ocontrol unit can access; said method comprising the steps of: thecommunication control unit receives a data write request from theexternal device; the I/O control unit adds to data to be written in eachsector of a series of sectors of the recording medium in which data isto be written caused by the data write request location informationwhich is information indicating a location of the sector in the seriesof sectors and common information which varies every time data writingto the series of sectors occurs and is information set relating to theseries of sectors.
 8. A method for controlling a computer constructedcomprising a communication control unit which provides a function tocommunicate with an external device; an I/O control unit which writesand reads data to and from a recording medium; a cash memory which thecommunication control unit and the I/O control unit can access; saidmethod comprising the steps of: the communication control unit receivesa data write request from the external device; the communication controlunit writes in data to be written in each sector of a series of sectorsof the recording medium in which data is to be written caused by thedata write request location information which is information indicatinga location of the sector in the series of sectors and common informationwhich varies every time data writing to the series of sectors occurs andis information set relating to the series of sectors; the I/O controlunit reads out the location information and the common informationwritten in each continuous sector of the recording medium when thecommunication control unit receives a data read request from theexternal device; the communication control unit validates data based onthe read out location information and common information.
 9. A methodfor controlling a computer constructed comprising a communicationcontrol unit which provides a function to communicate with an externaldevice; an I/O control unit which writes and reads data to and from arecording medium; a cash memory which the communication control unit andthe I/O control unit can access; said method comprising the steps of:the communication control unit receives a data write request from theexternal device; the communication control unit writes in data to bewritten in each sector of a series of sectors of the recording medium inwhich data is to be written caused by the data write request locationinformation which is information indicating a location of the sector inthe series of sectors and common information which varies every timedata writing to the series of sectors occurs and is information setrelating to the series of sectors; the I/O control unit reads out thelocation information and the common information written in eachcontinuous sector of the recording medium when the communication controlunit receives a data read request from the external device, andvalidates data based on the read out location information and commoninformation.
 10. A computer comprising: a communication control unitwhich provides a function to communicate with an external device; an I/Ocontrol unit which writes and reads data to and from a recording medium;a cash memory which the communication control unit and the I/O controlunit can access; means for writing in data to be written in each sectorof a series of sectors of the recording medium in which data is to bewritten caused by a data write request location information which isinformation indicating a location of the sector in the series of sectorsand common information which varies every time data writing to theseries of sectors occurs and is information set relating to the seriesof sectors when it receives the data write request from the externaldevice; means for reading out the location information and the commoninformation written in each continuous sector of the recording mediumwhen it receives a data read request from the external device; means forvalidating data based on the read out location information and commoninformation.
 11. A disk array unit comprising a plurality of diskdrives, a disk controller which controls writing and reading of data tothe disk drive by the RAID5 method, wherein: when writing data to thedisk drive according to the read modify write method, the disk arrayunit writes in each sector of a series of sectors of the recordingmedium in which data is to be written caused by a single data writerequest location information which is information indicating a locationof the sector in the series of sectors and common information whichvaries every time data writing to the series of sectors occurs and isinformation set relating to the series of sectors.
 12. A disk drivecomprising: a magnetic disk; communication means for communicating withan external device; access means for writing and reading data to andfrom the magnetic disk corresponding to a control signal received by thecommunication means; write means for writing in each sector of a seriesof sectors of the recording medium in which data is to be written causedby a single data write request location information which is informationindicating a location of the sector in the series of sectors and commoninformation which varies every time data writing to the series ofsectors occurs and is information set relating to the series of sectors.13. A disk drive comprising: a magnetic disk; communication means forcommunicating with an external device; access means for writing andreading data to and from the magnetic disk corresponding to a controlsignal received by the communication means; validation means which readsout the location information and the common information written in eachcontinuous sector of the recording medium and validates data based onthe read out location information and common information.
 14. A diskdrive comprising: a magnetic disk; communication means for communicatingwith an external device; access means for writing and reading data toand from the magnetic disk corresponding to a control signal received atcommunication means; validation means which reads out the locationinformation and the common information written in each continuous sectorof the recording medium and validates data based on the read outlocation information and common information; signal output means whichoutputs a signal indicating that an abnormality has occurred when anabnormality is detected by the validation.